package com.solcoo.customer.ui.qrcode;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.android.common.image.ImageLoader;
import com.android.common.image.convertor.RoundedCornerConvertor;
import com.solcoo.customer.ApplicationExt;
import com.solcoo.customer.R;
import com.solcoo.customer.base.BaseActivity;

public class QrcodeActivity extends BaseActivity {
	ImageView qrcodeView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.qrcode);
		qrcodeView = (ImageView) findViewById(R.id.qrcode);
		qrcodeView.setImageBitmap(ApplicationExt.getUser().getQrcode());
		fillUserInfo();
	}

	private void fillUserInfo() {
		ImageView head = (ImageView) findViewById(R.id.head_pic);
		ImageView sex = (ImageView) findViewById(R.id.sex_icon);
		TextView nick = (TextView) findViewById(R.id.nick);
		TextView cardNo = (TextView) findViewById(R.id.card_no);

		sex.setImageResource(ApplicationExt.getUser().getSexResId());
		ImageLoader.getInstance().load(ApplicationExt.getUser().touxiang, head,
				RoundedCornerConvertor.getInstance());
		nick.setText(ApplicationExt.getUser().nicheng);
		cardNo.setText("搜卡号：" + ApplicationExt.getUser().yonghum);
	}

}
